package com.medicine.lungs.service;

import com.medicine.lungs.mapper.LungsCtMapper;
import com.medicine.pojo.Patient;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author SongMin
 * @date 2021/6/1
 */

@Service
public class LungsCtService {
    @Resource
    private LungsCtMapper lungsCtMapper;

    public Patient queryLungsInfo() {
        return lungsCtMapper.queryLungsInfo();
    }

    public List<Map<String, Object>> queryLungsInfoByCtId(int CtId) {
        return lungsCtMapper.queryLungsInfoByCtId(CtId);
    }

    public Patient queryLungsInfoById(int id) {
        return lungsCtMapper.queryLungsInfoById(id);
    }

    public List<Patient> queryLungsInfoByName(String name) {
        return lungsCtMapper.queryLungsInfoByName(name);
    }

    public List ExceptionId(int id) {
        List cts = lungsCtMapper.querryCtListById(id);
        List labels = lungsCtMapper.querryLabelListById(id);
        List excps = new ArrayList();
        for (Object i : cts) {
            for (Object j : labels) {
                if (i == j) {
                    excps.add(j);
                }
            }
        }
        return excps;
    }
    public List ExceptionId() {
        List cts = lungsCtMapper.querryCtList();
        List labels = lungsCtMapper.querryLabelList();
        List excps = new ArrayList();
        for (Object i : cts) {
            for (Object j : labels) {
                if (i == j) {
                    excps.add(j);
                }
            }
        }
        return excps;
    }

    public Map<String, Object> queryLabelInfoById(int id){
        return lungsCtMapper.queryLabelInfoById(id);
    }

    public List<Map<String, Object>> queryResultsById(int id){
        return lungsCtMapper.queryResultsById(id);
    }
    public List<Map<String, Object>> queryResults(){
        return lungsCtMapper.queryResults();
    }
}
